<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="leagal_aid.bean.*,java.util.*,java.io.*" %>
<%@page import="java.text.SimpleDateFormat"%>
<%
String username=null;
if(session.getAttribute("username")==null || session.getAttribute("username").equals("")){
	response.setCharacterEncoding("utf-8");
	PrintWriter pout = response.getWriter();
	pout.print("<script>alert('请先登录'); window.location='../login.jsp' </script>");
	pout.flush();
	pout.close();
}
else{
	username = session.getAttribute("username").toString();
}
Date d = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String now = df.format(d);

ContactBean contactBean = new ContactBean();
contactBean = contactBean.findAll();	
%>
<!DOCTYPE html>
<html lang="en">

    <head>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>在线留言</title>

        <!-- 在线留言CSS -->
        <link rel="stylesheet" href="../css/bootstrap.min.css">
		<link rel="stylesheet" href="../css/form-elements.css">
        <link rel="stylesheet" href="../css/style.css">
    </head>

    <body style="background-color: #e8e8e8;">
                        <div class="col-sm-6 col-sm-offset-3 form-box">
                        	<div class="form-top">
                        		<div class="form-top-left">
                        			<h3>联系我们</h3>
                        		</div>
                        		<div class="form-top-right">
                        			<i class="fa fa-envelope"></i>
                        		</div>
                            </div>
                            <div class="form-bottom contact-form">
			                    <form role="form" action="operating_message/doupdate.jsp?id=<%=contactBean.getId() %>" method="post">
			                    <input name="category" style="display: none;" value="message">
			                    <input name="txtDate" style="display: none;" value="<%=now%>">
			                        <div class="form-group">
			                        	<label class="sr-only" for="contact-message">标题</label>
                                        <input type="text" name="title" placeholder="<%=contactBean.getTitle()%>" value="<%=contactBean.getTitle()%>" class="contact-subject form-control" id="contact-subject">
			                        </div>			                    
			                    	<div class="form-group">
			                    		<label class="sr-only" for="contact-email">姓名</label>
			                        	<input type="text" name="name" placeholder="<%=contactBean.getName() %>" value="<%=contactBean.getName() %>" class="contact-email form-control" id="contact-email">
			                        </div>
                                    <div class="form-group">
                                        <label class="sr-only" for="contact-subject">电话</label>
                                        <input type="text" name="telephone" placeholder="<%=contactBean.getTelephone() %>" value="<%=contactBean.getTelephone() %>" class="contact-subject form-control" id="contact-subject">
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only" for="contact-subject">邮箱</label>
                                        <input type="text" name="email" placeholder="<%=contactBean.getEmail() %>" value="<%=contactBean.getEmail() %>" class="contact-subject form-control" id="contact-subject">
                                    </div>
			                        <div class="form-group">
			                        	<label class="sr-only" for="contact-message">地址</label>
                                        <input type="text" name="address" placeholder="<%=contactBean.getAddress() %>" value="<%=contactBean.getAddress() %>" class="contact-subject form-control" id="contact-subject">
			                        </div>    
			                        <button type="submit" class="btn" style="width:40%;">修改</button>
			                    </form>
		                    </div>
                        </div>

        
        <!--[if lt IE 10]>
            <script src="assets/js/placeholder.js"></script>
        <![endif]-->

    </body>

</html>